﻿using Architecture.Api.Application.Command.MenuCommand;
using Architecture.Domain.RBAC;
using Architecture.Service;
using MediatR;

namespace Architecture.Api.Application.CommandHandlers.MenuHandler
{
    public class MenuFrameCommandHandler : IRequestHandler<MenuFrameCommand, List<Menu>>
    {
        protected readonly IMenuService _menuService;

        public MenuFrameCommandHandler(IMenuService menuService)
        {
            _menuService = menuService;
        }
        public async Task<List<Menu>> Handle(MenuFrameCommand request, CancellationToken cancellationToken)
        {
            return await _menuService.GetNameAsync();
        }
    }
}
